package com.zhkc.wisdom.common.pojo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * @Description 响应码枚举类
 * @User zzw
 * @Date 11:05 2023/11/5
 * @company zhkc
 */
@Getter
@AllArgsConstructor
public enum ResponseCodeEnum {
    SUCCESS(HttpStatus.OK.value(), "请求成功"),
    FAIL(HttpStatus.INTERNAL_SERVER_ERROR.value(), "请求失败"),

    TOKEN_INVALID(HttpStatus.UNAUTHORIZED.value(), "缺少认证信息"),
    BAD_PARAM(HttpStatus.BAD_REQUEST.value(), "请求参数错误"),
    UNLOGIN_ERROR(HttpStatus.UNAUTHORIZED.value(), "未登录"),
    AUTH_ERROR(HttpStatus.UNAUTHORIZED.value(), "权限不足"),

    LOGIN_SUCCESS(HttpStatus.OK.value(), "登录成功"),
    LOGOUT_SUCCESS(HttpStatus.OK.value(), "注销成功"),
    TOKEN_LOSS(901, "token信息丢失"),
    FAIL_EXCEED_NUM(902, "超出登录失败次数，账户被锁定"),
    OPERATION_TIMEOUT(903, "长时间未操作，自动登出"),
    LOGIN_ERROR(904, "账号或密码错误"),
    VERIFY_CODE_ERROR(905, "验证码错误"),

    TOKEN_NULL_ERROR(11011, "Token无效"),
    INVALID_ERROR(11012, "Token无效"),
    BE_OVERDUE_ERROR(11013, "登录已过期"),
    SYSTEM_ERROR(1000, "系统异常");

    private Integer code;
    private String msg;
}
